import type { App } from "vue";
import { createPinia } from "pinia";
//pinia
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import { shareStorePlugin } from "./plugins";
const store = createPinia();
// 添加持久化插件
store.use(piniaPluginPersistedstate);
// 添加状态共享插件
store.use(shareStorePlugin);

// 全局挂载store
export function setupStore(app: App<Element>) {
    app.use(store);
}

export { store };
